/**
 * Title: Hyperbolic engine
 * Description: jFamilyTree Engine
 * Version: 2.0.x
 * Copyright: (c) 2001-2008
 * Terms of use:see license agreement at http://treebolic.sourceforge.net/en/license.htm
 * Author: Bernard Bou
 * Company: bsys
 * Update: Mon Mar 10 00:00:00 CEST 2008
 */

package jFamilyTree;

import jFamilyTree.model.Model;

/**
 * jFamilyTree's main panel. Call either init() to feed the data
 * 
 * @author Bernard Bou
 */
public interface IWidget
{

	/**
	 * Init (typically called by embedding applet's init()). Data source and data provider have not yet been determined.
	 */
	public void init();

	/**
	 * Init (typically called by embedding applet's init()). Data source and data provider names have been determined.
	 * 
	 * @param thisProviderName
	 *        provider class name (null will default to XML provider)
	 * @param thisSource
	 *        source (anything the provider will make sense of)
	 */
	public void init(String thisProviderName, final String thisSource);

	/**
	 * Init from model
	 * 
	 * @param thisModel
	 *        model
	 */
	public void init(Model thisModel);

	/**
	 * Re-init from same provider and new source (this assumes the provider is loaded)
	 * 
	 * @param thisSource
	 *        data source
	 */
	public void reinit(final String thisSource);

	// Version

	/**
	 * Get version (wrapper)
	 */
	public String getVersion();

	// JavaScript

	/**
	 * Focus
	 * 
	 * @param thisNodeId
	 *        node id to get focus
	 */
	public void focus(String thisNodeId);

	/**
	 * Link to Url
	 * 
	 * @param thisUrlString
	 *        url string
	 * @param thisUrlTarget
	 *        target string
	 */
	public void link(String thisUrlString, String thisUrlTarget);

	/**
	 * Match node against string
	 * 
	 * @param thisTargetString
	 *        string to search for
	 * @param thisScopeString
	 *        scope ("label", "content", "link", "id")
	 * @param thisModeString
	 *        mode ("equals", "startswith", "includes")
	 * @return node id
	 */
	public String match(String thisTargetString, String thisScopeString, String thisModeString);
}
